<template>
  	<div>
    	<div class="zhehzhao" @click="gball()" v-if="showyy || tishi"></div>
		<van-pull-refresh
			v-model="isLoading"
			@refresh="onRefresh"
			:success-text="$t('m.sxcg')"
			v-if="inshow == 'index'"
		>
			<!-- 侧栏菜单弹窗 -->
			<van-popup
				v-model="show"
				position="left"
				:style="{ width: '60%', height: '100%' }"
			>
        		<div class="myinfo">
          			<div>
            			<div class="user">
              				<div class="u-nc txtc">
								{{
								this.$store.getters.userWallet
									? this.$store.getters.userWallet.replace(
										/(\w{4})\w+(\w{4})/,
										"$1...$2"
									)
									: $t("m.nowh")
								}}
              				</div>
              				<div class="u-id txtc">
								{{ $t("m.sqdj") }}:{{walletData.contractLevel==0?$t("m.tyyh"):walletData.contractLevel>0?walletData.contractLevel+'V'+$t("m.shequ"):$t("m.wxyh")}}
              				</div>
							<!-- 等级 -->
              				<!-- <div class="u-dj">{{ $t("m.dqdj") }}</div>
							<div class="u-sqdj">
								<van-rate v-model="s.gameLevel" readonly color="#01FFFB" />
							</div> -->
            			</div>
            			<div class="wl-list">
							<div class="wl-list-item" @click="goto('zc')">
                				<img src="../assets/images/wdzc.png" alt="" class="tb-icos" />
                				<div class="txtw">
									<!-- 我的资产 -->
									{{ $t("m.wodezichan") }}
								</div>
              				</div>
              				<div class="wl-list-item" @click="goto('investment')">
                				<img src="../assets/images/wdtz.png" alt="" class="tb-icos" />
                				<div class="txtw">
									<!-- 我的投资 -->
									{{ $t("m.wodetouzi") }}
								</div>
              				</div>
							<div class="wl-list-item" @click="yqhy()">
								<img src="../assets/images/yqhy.png" alt="" class="tb-icos" />
								<div class="txtw">
									<!-- 邀请好友 -->
									{{ $t("m.yqhy") }}
								</div>
							</div>
							<!-- 消息中心 -->
							<div class="wl-list-item" @click="goto('xx')">
								<img src="../assets/images/xxzx.png" alt="" class="tb-icos" />
								<div class="txtw">
									
									{{ $t("m.xxzx") }}
								</div>
							</div>
							<!-- 常见问题 -->
							<div class="wl-list-item" @click="goto('bzzx')">
								<img src="../assets/images/cjwt.png" alt="" class="tb-icos" />
								<div class="txtw">
									
									{{ $t("m.cjwt") }}
								</div>
							</div>
							<!-- 关于我们 -->
							<div class="wl-list-item" @click="goto('bzzx')">
								<img src="../assets/images/cjwt.png" alt="" class="tb-icos" />
								<div class="txtw">
									
									{{ $t("m.gywm") }}
								</div>
							</div>
							<!-- <div class="wl-list-item" @click="goto('wdgd')">
								<img src="../assets/timg/wdgd.png" alt="" class="tb-icos" />
								<div class="txtw">{{ $t("m.wdgd") }}</div>
							</div> -->
            			</div>
          			</div>
        		</div>
      		</van-popup>
			<!-- 主页 -->
			<div class="game">
				<div class="kaifudjs" v-if="kftime > 0">
					<span>{{ $t("m.kfdjs") }}</span>
					<van-count-down :time="kftime" format="DD d HH h mm m ss s" />
				</div>
				<!-- 头部 -->
				<div class="btops">
					<div class="menu" @click="myinfo()"></div>
					<div class="logo">
						<img src="../assets/images/logo.png" alt="" srcset="">
					</div>
					<!-- <div class="addsde">
						{{
							this.$store.getters.userWallet?
							this.$store.getters.userWallet.replace(/(\w{4})\w+(\w{4})/,"$1...$2"): $t("m.now")
						}}
					</div> -->
					<div class="tright">
						<!-- <div class="xzyyb slideIn" v-if="showyy">
							<div class="liem" @click="changeryys('en-US')">
								<img src="../assets/timg/en.png" alt="" />
								<div>EN</div>
							</div>
							<div class="liem" @click="changeryys('zh-CN')">
								<img src="../assets/timg/zw.png" alt="" />
								<div>中文</div>
							</div>
						</div> -->
						<div class="lang_ico" @click="getshow()">
							<img src="../assets/timg/yy_zh.png"  v-if="language == 'en-US'" />
							<img src="../assets/timg/yy_en.png"  v-else />
						</div>
						
					</div>
					<!-- <div class="top">
						<div class="link">
							<div class="ictx" :class="[s.gameLevel ? 'lotx' + s.gameLevel : 'lotx0']" @click="myinfo()"></div>
							<div class="addsde">
								{{
								this.$store.getters.userWallet
									? this.$store.getters.userWallet.replace(
										/(\w{4})\w+(\w{4})/,
										"$1...$2"
									)
									: $t("m.now")
								}}
							</div>
						</div>
						<div class="tright">
							<div class="xzyyb slideIn" v-if="showyy">
								<div class="liem" @click="changeryys('en-US')">
									<img src="../assets/timg/en.png" alt="" />
									<div>EN</div>
								</div>
								<div class="liem" @click="changeryys('zh-CN')">
									<img src="../assets/timg/zw.png" alt="" />
									<div>中文</div>
								</div>
							</div>
							<div class="ictx" @click="getshow()">
								<img src="../assets/timg/yy_zh.png" class="ictx" v-if="dqyy == 'zh-CN'" />
								<img src="../assets/timg/yy_en.png" class="ictx" v-else />
							</div>
							<div class="ictx">
								<img
									src="../assets/timg/xx.png"
									alt=""
									class="ictx"
									@click="goto('xx')"
								/>
								<div class="redtip" v-if="ggmode"></div>
							</div>
						</div>
					</div>

					<div class="topbtn">
						<div class="tb-item" @click="goto('zc')">
							<span class="tbico-1"></span>
							<span>{{ $t("m.zc") }}</span>
						</div>
						<div class="tb-item" @click="goto('bzdh')">
							<span class="tbico-2"></span>
							<span>{{ $t("m.sd") }}</span>
						</div>
						<div class="tb-item" @click="yqhy()">
							<span class="tbico-3"></span>
							<span>{{ $t("m.yq") }}</span>
						</div>
						<div class="tb-item" @click="goto('cjjd')">
							<span class="tbico-4"></span>
							<span>{{ $t("m.jd") }}</span>
						</div>
					</div> -->
				</div>
				<!-- banner -->
				<div class="banner">
					<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
						<van-swipe-item>
							<div class="img">
								<img src="../assets/images/banner1.png" alt="">
							</div>
						</van-swipe-item>
						<van-swipe-item>
							<div class="img">
								<img src="../assets/images/banner.png" alt="">
							</div>
						</van-swipe-item>
					</van-swipe>
				</div>
				<!-- 资产 -->
				<div class="assets">
					<div class="lf">
						<div class="title" @click="goto('zc')">
							<p>
								<!-- 总资产(USDT) -->
								{{$t("m.zongzichan")}}（USDT）
							</p>
							<p><van-icon name="arrow" /></p>
						</div>
						<div class="center">
							<div class="number">
								{{walletData.trxAmount>0?walletData.trxAmount.toFixed(4):'0.0000'}}
								<!-- <span>
									≈¥{{walletData.withdrawal>0?walletData.withdrawal.toFixed(2):'0.00'}}
								</span> -->
							</div>
							
						</div>
						<div class="btm">
							<div class="title">
								<!-- 总锁仓-->
								<!-- <p>
									
									{{$t("m.zongsuocang")}}
								</p> -->
								<p>
									<!-- 总收益 -->
									{{$t("m.zsy")}}
								</p>
							</div>
							<div class="price">
								<!-- <p>
									0.0000
								</p> -->
								<p>
									0.0000
								</p>
								<div class="price">
									<div class="lr">
										<div v-if="walletData.userLevel=='-1'" class="btn" @click="activationClick">
											<!-- 激活 -->
											{{$t("m.jihuo")}}
										</div>
										<div v-else class="btn" @click="upgrade">
											<!-- 升级 -->
											{{$t("m.shengji")}}
										</div>
									</div>
								</div>
							</div>
						</div>
						<!-- <div class="more" :class="{active:active}" @click="moreClick">
							<img src="../assets/images/dw.png" alt="" srcset="">
						</div> -->
					</div>
					
				</div>
				<!-- 矿池 -->
				<div class="pool">
					<div class="title">
						<p :class="{navactive:pool_active==0}" @click="tabNav(0)">
							<!-- DEFI挖矿 -->
							
							DEFI{{$t("m.wk")}}
						</p>
						<p :class="{navactive:pool_active==1}" @click="tabNav(1)">
							<!-- 算力挖矿 -->
							
							{{$t("m.suanli")}}{{$t("m.wk")}}
						</p>
						<p :class="{navactive:pool_active==2}" @click="tabNav(2)">
							<!-- 邀请好友 -->
							
							{{$t("m.yqhy")}}
						</p>
						<p :class="{navactive:pool_active==3}" @click="tabNav(3)">
							<!-- 挖矿记录 -->
							
							{{$t("m.wkjl")}}
						</p>
					</div>
					<div class="item" v-for="item in dataList" :key="item.id">
						<div class="lf">
							<div class="title">
								<img src="../assets/images/pool_u.png" alt="" srcset="">
								<!-- <img src="../assets/images/pool_b.png" alt="" srcset="">
								<img src="../assets/images/pool_f.png" alt="" srcset="">
								<img src="../assets/images/pool_h.png" alt="" srcset=""> -->
								<p>{{item.title}}</p>
							</div>
							<div class="btm">
								<div class="btm_item">
									<div class="item_cont">
										{{item.radio*100}}%
									</div>
									<div class="item_title">
										<!-- 年化收益率 -->
										{{$t("m.nianhuashouyilv")}}
									</div>
									
								</div>
								<div class="btm_item">
									<div class="item_cont">
										{{item.minPay}}USDT
									</div>
									<div class="item_title">
										<!-- 起投金额 -->
										{{$t("m.qitoujine")}}
									</div>
									
								</div>
								<div class="btm_item">
									<div class="item_cont">
										{{item.day}}{{$t("m.tian")}}
									</div>
									<div class="item_title">
										<!-- 挖矿周期 -->
										{{$t("m.wakuangzhouqi")}}
									</div>
									
								</div>
							</div>
						</div>
						<div class="lr" @click="investment(item)">
							<!-- 去挖矿 -->
							{{$t("m.lijitouzi")}}
						</div>
					</div>
				</div>
        		<!-- <div class="nuei">
					<img
						src="../assets/timg/tips.png"
						alt=""
						class="tb-ico ml-3"
						@click="goto('yxjs')"
					/>
          			<div @click="muisc()">
						<img
						src="../assets/timg/muics.png"
						alt=""
						class="tb-ico mr-3"
						v-if="music == 1"
						/>
						<img
						src="../assets/timg/nomuics.png"
						alt=""
						class="tb-ico mr-3"
						v-else
						/>
          			</div>

					<div class="ttipse slideOut" v-if="tishi">
						{{ $t("m.gmslbdy") }}
					</div>
        		</div> -->

        		<!-- <div class="gamebody">
          			<div class="leida" :class="[startgame ? 'jsdu' : 'putong']"></div>

					<div
						:class="[dqyy == 'zh-CN' ? 'kswk' : 'kswken']"
						@click="start()"
						v-if="gameshow == 1"
					></div>
					
					<div class="wkz" v-if="gameshow == 2">
						<div>匹配中...</div>
					</div>
					<div class="wkz" v-if="gameshow == 3">
						<div>({{ ktime }}s)</div>
						<div>{{ $t("m.wkz") }}</div>
					</div>

          			<div class="wkz" v-if="gameshow == 4">{{ $t("m.wkjg") }}</div>

					<div v-for="(i, index) in gamelist" :key="index">
						<div
						class="wj tanchu"
						:style="{ top: i.a + 'vw', left: i.b + 'vw' }"
						:class="['wk' + i.c]"
						></div>
					</div>
        		</div> -->

        		<!-- <div class="link mtpo">
					<div class="btg" @click="seebuysl()">
						<img src="../assets/timg/syslico.png" alt="" class="tb-ico2" />
						<div class="link" v-if="s.gameNum > 0">
							<div class="">{{ $t("m.sysl") }}:</div>
							<div class="">{{ tt.surplusGameNum }}{{ $t("m.juss") }}</div>
						</div>
						<div v-else>{{ $t("m.gmsl") }}</div>
					</div>
					<div class="btg">
						<img src="../assets/timg/tgico.png" alt="" class="tb-ico2" />
						<div class="link" @click="autogames()">
							<div class="scllow w20">{{ $t("m.zdwk") }}</div>
							<div :class="[tgshow ? 'kq' : 'gb']"></div>
						</div>
					</div>
        		</div> -->
        		<!-- <div class="line"></div> -->
        		<!-- <div>
          			<div class="info-tit">{{ $t("m.hyys") }}</div>
          			<div class="link m-2">
            			<div class="heyue">
              				<div class="icon1"></div>
							<div v-if="dqyy == 'en-US' && texts.con1En">
								<div
									v-for="(item, index) in texts.con1En.split('\n')"
									:key="index"
								>
									{{ item }}
								</div>
							</div>
							<div v-else-if="dqyy == 'zh-CN' && texts.con1">
								<div
								v-for="(item, index) in texts.con1.split('\n')"
								:key="index"
								>
									{{ item }}
								</div>
							</div>
            			</div>
            			<div class="heyuebg slideBig">
              				<div class="icon2"></div>
							<div v-if="dqyy == 'en-US' && texts.con2En">
								<div
								v-for="(item, index) in texts.con2En.split('\n')"
								:key="index"
								>
									{{ item }}
								</div>
							</div>
							<div v-else-if="dqyy == 'zh-CN' && texts.con2">
								<div
								v-for="(item, index) in texts.con2.split('\n')"
								:key="index"
								>
									{{ item }}
								</div>
							</div>
            			</div>
            			<div class="heyue">
              				<div class="icon3"></div>
							<div v-if="dqyy == 'en-US' && texts.con3En">
								<div
								v-for="(item, index) in texts.con3En.split('\n')"
								:key="index"
								>
									{{ item }}
								</div>
							</div>
							<div v-else-if="dqyy == 'zh-CN' && texts.con3">
								<div
								v-for="(item, index) in texts.con3.split('\n')"
								:key="index"
								>
									{{ item }}
								</div>
							</div>
            			</div>
          			</div>
        		</div> -->
        		<!-- <div class="line"></div> -->
        		<!-- <div class="info">
					<div class="info-tit">{{ $t("m.hyjz") }}</div>
					<div class="info-txt">{{ $t("m.zhdscgx") }}</div>
          			<div class="wl-tips">
						<div class="info-ic">
							<img src="../assets/timg/jyrs.png" alt="" />
						</div>
            			<div class="info-txtc">— {{ $t("m.jyrs") }} —</div>
						<div class="info-txt">
							<div v-if="dqyy == 'en-US'">
								<div>{{ texts.tranEn ? texts.tranEn : $t("m.Mrlckz") }}</div>
							</div>
							<div v-else>
								<div>{{ texts.tran ? texts.tran : $t("m.Mrlckz") }}</div>
							</div>
						</div>
          			</div>
          			<div class="wl-link">
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.dbzl") }}</div>
							<div class="wl-tp1">
								{{ jyrs ? jyrs.fxzl : "***" }}
							</div>
						</div>
						<div class="wl-kuang">
							<div class="wl-tp">{{ $t("m.rszl") }}</div>
							<div class="wl-tp1">
								{{ jyrs ? jyrs.ranshao.toFixed(4) : "***" }}
							</div>
						</div>
          			</div>
					<div class="wl-link">
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.rsl") }}</div>
							<div class="wl-tp1">{{ jyrs ? jyrs.ranshaolv : "***" }} %</div>
						</div>
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.cbdzs") }}</div>
							<div class="wl-tp1">
								{{ holders_count != null ? holders_count : "***" }}
							</div>
						</div>
					</div>

					<div class="wl-tips">
						<div class="info-ic">
							<img src="../assets/timg/cbfh.png" alt="" />
						</div>
						<div class="info-txtc">— {{ $t("m.cbfh") }} —</div>
						<div class="info-txt">
							<div v-if="dqyy == 'en-US'">
								<div>{{ texts.holdEn ? texts.holdEn : $t("m.mbzz") }}</div>
							</div>
							<div v-else>
								<div>{{ texts.hold ? texts.hold : $t("m.mbzz") }}</div>
							</div>
						</div>
					</div>
					<div class="wl-link">
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.fhc") }}</div>
							<div class="wl-tp1">
								{{ cbfh ? cbfh.fhc.toFixed(4) : "***" }}
							</div>
						</div>
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.fhdjs") }}</div>
							<div class="wl-tp1">{{ fhdjs ? fhdjs : "***" }}</div>
						</div>
					</div>

					<div class="wl-link">
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.kfhdzs") }}</div>
							<div class="wl-tp1">{{ fhs ? fhs.cashCount : "***" }}</div>
						</div>
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.mdzfhs") }}</div>
							<div class="wl-tp1">{{ fhs ? fhs.userCash : "***" }}</div>
						</div>
					</div>

					<div class="wl-tips">
						<div class="info-ic">
							<img src="../assets/timg/wdby.png" alt="" />
						</div>
						<div class="info-txtc">— {{ $t("m.wdby") }} —</div>
						<div class="info-txt">
							<div v-if="dqyy == 'en-US'">
								<div>{{ texts.tailEn ? texts.tailEn : $t("m.dbzzje") }}</div>
							</div>
							<div v-else>
								<div>{{ texts.tail ? texts.tail : $t("m.dbzzje") }}</div>
							</div>
						</div>
					</div>

					<div class="wl-link">
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.jjc") }}</div>
							<div class="wl-tp1">
								{{ wdby.jiangchi != null ? wdby.jiangchi.toFixed(4) : "***" }}
							</div>
						</div>
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.kjdjs") }}</div>
							<div class="wl-tp1">
								{{
								dengdai
									? $t("m.ddwd")
									: dcf
									? $t("m.dcf")
									: wtime != 1800
									? endformat(wtime)
									: "***"
								}}
							</div>
						</div>
					</div>
					<div class="wl-link">
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.zxcyje") }}</div>
							<div class="wl-tp1">{{ wdby.t2 != null ? wdby.t2 : "***" }}</div>
						</div>
						<div class="wl-kuang">
							<div class="wl-tp scllow w35">{{ $t("m.ykjs") }}</div>
							<div class="wl-tp1">{{ wdby.qh != null ? wdby.qh : "***" }}</div>
						</div>
					</div>

          			<div class="wl-dqjl">
            			<div class="tt">{{ $t("m.dqjllb") }}</div>

            			<div class="wl-lb">
							<div class="wl-dqjl-lb-top">
								<div class="wl-l1 txtc">{{ $t("m.px") }}</div>
								<div class="wl-l1 txtc">{{ $t("m.dz") }}</div>
								<div class="wl-l1 txtc">{{ $t("m.yjjl") }}</div>
							</div>
              				<div class="lisy" v-if="list.length > 0">
								<div
									class="wl-dqjl-item"
									v-for="(item, index) in list"
									:key="index"
								>
                  					<div class="wl-l1">{{ index + 1 }}</div>
									<div class="wl-l1">
										<span>{{item.address.replace(/(\w{4})\w+(\w{4})/, "$1****$2")}}</span>
										<button
										type="button"
										class="fuzhi"
										v-clipboard:copy="item.address"
										v-clipboard:success="onCopy"
										v-clipboard:error="onError"
										>
											<span class="fzbtn"> </span>
										</button>
									</div>
									<div class="wl-l1">
										{{
										wdby
											? index == 0
											? (wdby.jiangchi * 0.14).toFixed(4)
											: (wdby.jiangchi * 0.04).toFixed(4)
											: "***"
										}}
									</div>
                				</div>
              				</div>
							<div v-else>
								<div class="nodata"></div>
							</div>
            			</div>
          			</div>
        		</div> -->
        		<div class="line"></div>
        		<div class="wl-bottom">
					<!-- <div class="wl-bottom-icon link" v-if="dbotto">
						<div class="ewmtc" v-if="weixin">
							<img src="../assets/timg/ewm.jpg" alt="" class="ewmic" />
						</div>
						<div class="dianbao"></div>
						<div class="tuite"></div>
						<div class="weixin" @click="showweixin"></div>
					</div> -->
          			<!-- <div class="wl-txt-btn link">
						<div @click="goto('yxjs')"></div>
						<div @click="gotohydz()">{{ $t("m.hydz") }}</div>
						<div>{{ $t("m.sjbg") }}</div>
						<div @click="goa()">{{ $t("m.qwdh") }}</div>

						<div class="tetx">
							<span>{{ $t("m.hydz") }}: {{ heyue }} </span>
							<button
								type="button"
								class="fuzhi"
								v-clipboard:copy="heyue"
								v-clipboard:success="onCopy"
								v-clipboard:error="onError"
							>
								<span class="fzbtn"> </span>
							</button>
						</div>
          			</div> -->
					<div class="link_title">
						<!-- 合作伙伴 -->
						{{ $t("m.hzhb") }}
					</div>
					<div class="links">
						<div class="item">
							<a href="https://www.jinse.com">
								<div class="img">
									<img src="../assets/images/jinsecaijing.png" alt="">
								</div>
								<div class="title">金色财经</div>
							</a>
						</div>
						<div class="item">
							<a href="https://m.hecochain.com/zh-cn/">
								<div class="img">
									<img src="../assets/images/huobi.png" alt="">
								</div>
								<div class="title">HuobiECO Chain</div>
							</a>
						</div>
						<div class="item">
							<a href="https://swerve.fi/?ref=block123">
								<div class="img">
									<img src="../assets/images/swerve.png" alt="">
								</div>
								<div class="title">Swerve</div>
							</a>
						</div>
						<div class="item">
							<a href="https://www.chainup.com/zh-CN/">
								<div class="img">
									<img src="../assets/images/chainup.png" alt="">
								</div>
								<div class="title">链上ChainUp</div>
							</a>
						</div>
						<div class="item">
							<a href="https://app.compound.finance/?locale=zh-CN&utm_source=imtoken">
								<div class="img">
									<img src="../assets/images/conpound.png" alt="">
								</div>
								<div class="title">Compound</div>
							</a>
						</div>
						<div class="item">
							<a href="https://dao.curve.fi/?locale=zh-CN&utm_source=imtoken">
								<div class="img">
									<img src="../assets/images/curve.png" alt="">
								</div>
								<div class="title">Curve挖矿</div>
							</a>
						</div>
						<div class="item">
							<a href="https://uniswap.token.im/#/pool?locale=zh-CN&utm_source=imtoken">
								<div class="img">
									<img src="../assets/images/uniswap.png" alt="">
								</div>
								<div class="title">Uniswap</div>
							</a>
						</div>
						<div class="item">
							<a href="https://yearn.finance/?locale=zh-CN&utm_source=imtoken">
								<div class="img">
									<img src="../assets/images/yearn.png" alt="">
								</div>
								<div class="title">Yearn Finance</div>
							</a>
						</div>
					</div>
					<div class="footer">
						<div class="item">
							<!-- 随取随存 -->
							{{$t("m.sqsc")}}
						</div>
						<div class="item">
							<!-- 收益稳定 -->
							{{$t("m.sywd")}}
						</div>
						<div class="item">
							<!-- 精心挑选 -->
							{{$t("m.jxtx")}}
						</div>
					</div>
          			<div class="wl-botm">Copyright © TronStar all right reserved</div>
        		</div>
   			</div>
    	</van-pull-refresh>

    	<van-popup v-model="slshow" class="gmsl-bg">
      		<div class="sl-body">
        		<div class="txte">{{ $t("m.gmsl") }}</div>
				<div class="isdesd">
					<div class="tts">{{ $t("m.mryx") }}</div>
					<div>{{ vips.dailyGameNum }}{{ $t("m.juss") }}</div>
				</div>
				<div class="isdesd">
					<div class="tts">{{ $t("m.yxqx") }}</div>
					<div>{{ vips.expireDate }}{{ $t("m.tian") }}</div>
				</div>
				<div class="isdesd">
					<div class="tts">{{ $t("m.jg") }}</div>
					<div>1000USDT≈{{ vips.dot }}TROT</div>
				</div>
				<div class="isdesd">
					<div class="tts">{{ $t("m.dqye") }}</div>
					<div>{{ s.ftAmount }}TROT</div>
				</div>

        		<div class="bnts" @click="slmode()">{{ $t("m.gmsl") }}</div>
      		</div>
    	</van-popup>
    	<van-popup v-model="dqslshow" class="gmsl-bg">
      		<div class="sl-body">
        		<div class="txte">{{ $t("m.dqsl") }}</div>

				<div class="isdesd">
					<div class="tts">{{ $t("m.mryx") }}</div>
					<div>{{ s.gameNum }}{{ $t("m.juss") }}</div>
				</div>
				<div class="isdesd">
					<div class="tts">{{ $t("m.yxqx") }}</div>
					<div>{{ s.contractExpireDate }}</div>
				</div>
        		<div class="bnts" @click="guanbi()">{{ $t("m.gmsl") }}</div>
      		</div>
    	</van-popup>
		<!-- 绑定推荐人 -->
    	<van-popup :close-on-click-overlay="false" v-model="yqshow" class="yqbd-bg">
      		<div class="yama">
        		<div class="txte">{{ $t("m.bdtjr") }}</div>
				<div class="yqm_con">
					<input class="inputs" :placeholder="$t('m.qsrtjryqm')" name="" v-model="yqma" />
				</div>
        		<div class="bnts" @click="yqmaos()">{{ $t("m.queding") }}</div>
      		</div>
    	</van-popup>
		<!-- 邀请好友弹窗 -->
    	<van-popup v-model="yqhyshow" class="yqhy-bg">
      		<div class="yama">
        		<div class="txte">{{ $t("m.yqhy") }}</div>
        		<div class="sdawda">
          			<div class="tts">{{ $t("m.yqm") }}</div>
          			<div class="isde">
            			<div>{{ walletData.trxAddress ? walletData.trxAddress : "" }}</div>
						<button
						type="button"
						class="fuzhi"
						v-clipboard:copy="walletData.trxAddress"
						v-clipboard:success="onCopy"
						v-clipboard:error="onError"
						>
							<img src="../assets/timg/fz.png" alt="" class="ff" />
						</button>
          			</div>
        		</div>
        		<div class="sdawda">
          			<div class="tts">{{ $t("m.yqlj") }}</div>
          			<div class="isde">
            			<div>{{ code }}</div>
						<button
						type="button"
						class="fuzhi"
						v-clipboard:copy="code"
						v-clipboard:success="onCopy"
						v-clipboard:error="onError"
						>
							<img src="../assets/timg/fz.png" alt="" class="ff" />
						</button>
          			</div>
          			<div class="defcf m-1 t-left">{{ $t("m.tgyqmyqndhy") }}</div>
        		</div>

        		<div class="bnts" @click="yqhaos()">{{ $t("m.queding") }}</div>
      		</div>
    	</van-popup>
		<!-- 激活弹窗 -->
		<van-popup
			v-model="activation"
			class="activation-bg"
			:style="{ top: '50%' }"
			:close-on-click-overlay="false"
		>
      		<div class="activation_cont">
				<div class="title">激活/升级</div>
				<div class="item">
					<p>当前等级</p>
					<p>体验用户</p>
				</div>
				<div class="item">
					<p>下一等级</p>
					<p>一级社区</p>
				</div>
				<div class="item">
					<p>激活金额</p>
					<p>0USDT</p>
				</div>
				<div class="close" @click="activationClose">关闭</div>
			</div>
    	</van-popup>
    	<van-popup
			v-model="winshow"
			class="win-bg"
			:style="{ top: '50%' }"
			:close-on-click-overlay="false"
		>
      		<div class="caidan">
        		<div class="win-tit">{{ $t("m.gxnzjl") }}</div>
				<div class="winbody">
					<div class="winnum">{{ baseFt }}TROT</div>
					<div class="ttx">{{ $t("m.sfjxwk") }}?</div>
				</div>
        		<div class="winbtn">
					<div class="bnts" @click="jixu">
						{{ $t("m.jx") }} {{ tgshow ? atime + "s" : "" }}
					</div>
          			<div class="bnts" @click="quxiao">{{ $t("m.qx") }}</div>
        		</div>
      		</div>
    	</van-popup>

		<van-popup
			v-model="losershow"
			class="loser-bg"
			:close-on-click-overlay="false"
		>
      		<div class="loser-body">
        		<div class="txte m-2">{{ $t("m.wdwkjl") }}</div>
        		<div class="txte">{{ baseCny }}USDT</div>
        		<div class="sfttx">{{ $t("m.sfjxwk") }}？</div>
        		<div class="loserbtn">
					<div class="sbnts" @click="jixu">
						{{ $t("m.jx") }} {{ tgshow ? atime + "s" : "" }}
					</div>
          			<div class="sbnts" @click="quxiao">{{ $t("m.qx") }}</div>
        		</div>
      		</div>
    	</van-popup>

		<van-popup
			v-model="nowhshow"
			class="yqbd-bg"
			:close-on-click-overlay="false"
		>
      		<div class="yama">
        		<div class="txte">{{ $t("m.nowh") }}</div>
				<div class="sdawda txtc">{{ $t("m.nowhs") }}</div>
        		<div class="bnts" @click="nowhshows()">{{ $t("m.chonglian") }}</div>
      		</div>
    	</van-popup>
		<!-- 升级弹窗 -->
		<van-popup v-model="showPicker" round position="bottom">
			<div class="contractlist">
				<div class="item" v-for="item in contractlist" :key="item.id" >
					<div class="lv">
						<p class="title">LV</p>
						<p>{{item.level}}</p>
					</div>
					<div class="price">
						<p class="title">{{$t("m.guige")}}</p>
						<p>{{item.spec}}</p>
					</div>
					<div v-show="walletData.contractLevel<item.level" class="btn" @click="onConfirm(item.id,item.spec)">{{$t("m.shengji")}}</div>
					<div class="sj" v-show="walletData.contractLevel>=item.level">升级</div>
				</div>
			</div>
		</van-popup>
		
  	</div>
</template>

<script>
import { getjyrs, getcbfh, getwdby, getABIs } from "../api/tron";
export default {
  	name: "name",
  	data() {
    	return {
			pool_active:0,
			active:false,
			language:'',
			showPicker:false,//是否显示升级弹窗
			contractlist:{},//合约列表
			activation:false,//是否展示激活弹窗
			dataList:{},//产品列表
			walletData:{},//钱包信息
			yqshow: false,//绑定推荐人弹窗
			heyue: "TWBu2NEjHbo6Wg8T6JrrebPLLmExEsrqPd",
			kftime: "",
			ggmode: false,
			dbotto: false,
			list: [],
			ad: "123",
			gamelist: [],
			s: [],
			tt: [],
			yqma: "",
			code: "",
			Email: "www.123456@163.com",
			value: 2,
			atime: 3,
			atimer: "",
			ktime: 5,
			ktiemr: "",
			time: 5,
			timer: "",
			wtime: 1800,
			wtimer: "",
			dcf: false,
			dengdai: false,
			state: false,
			suoding: false,
			gameshow: 1,
			show: false,
			tishi: false,
			tgshow: false,
			music: this.$store.getters.bjmuiscs || 0,
			winshow: false,
			losershow: false,
			inshow: sessionStorage.getItem("pages") || "index",
			isLoading: false,
			yqhyshow: false,
			shows: true,
			slshow: false,
			dqslshow: false,
			slactive: 0,
			showyy: false,
			datas: "",
			fhdjs: 0,
			holders_count: 0,
			weixin: false,
			startgame: false,
			sfzj: false,
			hylist: [],
			vips: "",
			hysuoding: false,
			baseFt: "",
			baseCny: "",
			userId: "",
			news: [],
			ggshow: false,
			yqmcode: "",
			jyrs: "",
			cbfh: "",
			wdby: "",
			fhs: [],
			texts: "",
    	};
  	},
  	created() {
		this.language = this.dqyy
		this.getWallet()
		// this.gettext();
		// this.kftime = this.djs(2020, 11, 11, 0, 0, 0);
		// this.get();
		// this.get1();
		// this.get2();
		// this.get3();
		this.getList();
		// 查询合约列表
		this.getlist()
		// this.getfh();
		// this.getfhtime();
		// this.getdata();
		// this.getbasedata();
		// this.getgameNum();
		// this.yqmcode = this.getQueryString("code");
		// console.log(this.yqmcode);
		
	},
	
  	computed: {
    	nowhshow() {
			if (this.$store.getters.userWallet) {
				return false;
			} else {
				return true;
			}
    	},
		dqyy() {
			if (this.$store.getters.language) {
				return this.$store.getters.language;
			} else {
				return "zh-CN";
			}
		},
  	},

  	methods: {
		// 导航切换
		tabNav(e){
			if (e==0) {
				this.pool_active = e
			}
			if (e==1) {
				this.$toast('该功能暂未开放');
			}
			if (e==2) {
				this.yqhy()
			}
			if (e==3) {
				this.goto('investment')
			}
			
		},
		// 切换语言
		getshow() {
			console.log('切换语言---------',this.dqyy)
			// this.showyy = !this.showyy;
			this.$i18n.locale = this.language=='zh-CN'?'en-US':'zh-CN';
			this.language = this.language=='zh-CN'?'en-US':'zh-CN';
			this.$store.commit("language", this.language);
		},
		// 点击邀请好友
		yqhy() {
			if (this.$store.getters.s.recommendId) {
				this.yqhyshow = true;
			} else {
				this.yqshow = true;
			}
		},
		// 绑定推荐人
    	yqmaos() {
      		if (this.yqma) {
				this.$toast.loading({
					message:this.$i18n.t("m.dfz"),
					forbidClick: true
				});
				var datas = {
					recommendAddress : this.yqma,
					trxAddress: this.$store.getters.userWallet,
				};
        		this.$get({
          			url: "wms-wallet/createRecommend",
          			data: datas,
          			callback: (data) => {
            			this.$nextTick(function () {
              				var list = data.data;
              				if (list) {
								this.$toast(this.$i18n.t("m.bdcg"));
								this.yqshow = false;
								this.yqmcode = "";
								this.getList()
								// this.getdata();
								// this.getgameNum();
              				} else {
								if (this.dqyy == "en-US") {
									this.$toast(this.$i18n.t("m.qsryqm"));
								} else {
									this.$toast(data.message);
								}
              				}
            			});
          			},
				}).catch(() => {
					this.$toast(this.$i18n.t("m.errordata"));
				});
      		} else {
				this.$toast(this.$i18n.t("m.qsryqm"));
				return;
      		}
    	},
		// 下拉刷新
    	onRefresh() {
			setTimeout(() => {
				this.isLoading = false;
			}, 1000);
			this.getWallet()
			this.getList();
			// this.getdata();
			// this.getgameNum();
    	},
		//总资产展开收起
		moreClick(){
			this.active = !this.active
		},
		// 查询钱包
		getWallet(){
			this.$get({
				url:"wms-wallet/getWallet",
				data:{
					address:this.$store.getters.userWallet
				},
				callback:(data)=>{
					console.log('查询钱包---------------',data)
					this.$nextTick(function () {
						var t = data.data;
						if (t) {
							this.walletData = data.data;
							this.$store.commit("nameid", data.data.id);
							this.$store.commit("s", data.data);
							// 判断是否绑定推荐人
							if (!data.data.recommendId) {
								//打开绑定推荐人弹框
								this.yqshow = true;
							}
						}
					});
				}
			})
		},
		//确认升级
		onConfirm(cid,spec){
			this.$toast.loading({
				message: '加载中...',
				forbidClick: true,
			});
			this.$post({
				url: "ums-contract-history/createContractHistory",
				data:{
					cid:cid,
					spec:spec,
					uid:this.walletData.id,
					trxAddress: this.$store.getters.userWallet
				},
				callback: (data) => {
					this.showPicker = false
					console.log('升级----------',data)
					if (data.code == 200) {
						
					}
					this.$toast.fail(data.message);
				},
			});
		},
		// 升级
		upgrade(){
			this.showPicker = true
		},
		//查询合约列表
		getlist(){
			this.$get({
				url: "ums-contract/getContractList",
				data:{
					state:0
				},
				callback: (data) => {
					console.log('合约列表----------',data)
					if (data.code == 200) {
						this.contractlist = data.data
					}
					
				},
			});
		},
		// 点击激活按钮
		async activationClick(){
			this.$toast.loading({
				message: '加载中...',
				forbidClick: true,
			});
			await this.$get({
				url: "ums-contract-history/activate",
				data:{
					trxAddress: this.$store.getters.userWallet
				},
				callback: (data) => {
					console.log('激活----------',data)
					
					if (data.code == 200) {
						this.getlist()
						this.getWallet()
						this.activation = true
					}
					this.$toast.fail(data.message);
				},
			});
			
		},
		// 关闭激活弹窗
		activationClose(){
			this.activation = false
		},
		// 获取产品列表
		getList(){
			this.$get({
				url:'/ums-product/getProductList',
				data:{state:1},
				callback:(data)=>{
					console.log('产品列表----------',data)
					this.$nextTick(function(){
						if (data.code == 200) {
							this.dataList = data.data
						}
					})
				}
				
			})
			
		},
		// 立即投资
		investment(e){
			console.log('立即投资---------',e)
			this.$router.push({ name: 'investment_detail', params: {id:e.id}}) // -> /user
		},
		gettext() {
			this.$get({
				url: "ums-contract/getWebsiteContent",
				data: {},
				callback: (data) => {
					this.$nextTick(function () {
						if (data.data) {
						this.texts = data.data;
						}
					});
				},
			});
		},
		get1() {
			getjyrs().then((res) => {
				this.jyrs = res;
			});
		},
		get2() {
			getcbfh().then((res) => {
				this.cbfh = res;
			});
		},
    	get3() {
      		getwdby().then((res) => {
        		this.wdby = res;
				if (this.wdby.win == "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb") {
					this.dengdai = true;
				} else {
					this.dengdai = false;
				}
        		var a = this.wdby.nowtime - this.wdby.endTime;
        		// // clearInterval(this.wtimer);
        		console.log("A:", a);
        		this.dcf = false;
        		console.log("B:", this.wdby.sc);
        		var b = this.wdby.sc - a;
        		console.log("B:", b);
				if (b > 0) {
					this.daojshi(b);
				} else if (b == 0) {
					this.daojshi(this.wdby.sc);
				} else {
					this.dcf = true;
				}
      		});
    	},

		getQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
			var r = window.location.search.substr(1).match(reg);
			if (r != null) return unescape(r[2]);
			return null;
		},

		djs(year, month, day, hour, minute, second) {
			var t = new Date(year, month - 1, day, hour, minute, second) - new Date();
			return t;
		},
    	nowhshows() {
      		if (typeof window.tronWeb !== "undefined") {
				this.$store.commit("userWallet", window.tronWeb.defaultAddress.base58);
				let datas = {
					trxAddress: window.tronWeb.defaultAddress.base58,
				};
        		this.$post({
          			url: "wms-wallet/createWallet",
          			data: datas,
          			callback: (data) => {
            			this.$nextTick(function () {
              				var t = data.data;
							if (t) {
								this.$store.commit("nameid", this.mydatas.id);
								this.$store.commit("usdt", this.mydatas.trxAmount);
								this.$store.commit("dot", this.mydatas.ftAmount);
							}
            			});
          			},
        		}).catch(() => {
          			this.$toast(this.$i18n.t("m.errordata"));
        		});
      		}
    	},
    	getfh() {
      		if (this.$store.getters.nameid) {
				var datas = {
					params: {
						uid: this.$store.getters.nameid,
					},
				};
        		this.$get({
         	 		url: "wms-wallet-history/getCashInfo",
          			data: datas,
          			callback: (data) => {
						this.$nextTick(function () {
							if (data.data) {
								this.fhs = data.data;
							}
						});
          			},
        		});
      		} else {
				setTimeout(() => {
					this.getfh();
				}, 10);
      		}
    	},
    	getRate() {
      		this.$get({
				url: "oms-ore-pool/get0Rate",
				data: {},
        		callback: (data) => {
          			this.$nextTick(function () {
            			var s = data.data;
            			if (s) {
							if (this.dqyy == "en-US") {
								this.$store.commit("ttoc", s.token_usdt);
								this.$store.commit("utoc", s.trx_usdt);
								this.$store.commit("ttou", s.token_trx);
							} else {
								this.$store.commit("ttoc", s.token_cny);
								this.$store.commit("utoc", s.trx_cny);
								this.$store.commit("ttou", s.token_trx);
							}
            			}
          			});
        		},
			}).catch(() => {
				this.$toast(this.$i18n.t("m.errordata"));
			});
    	},
    	createArr(num) {
			let arr = [];
			for (let i = 0; i < num; i++) {
				arr.push(i + 1);
			}
      		let result = [];
			for (let i = arr.length - 1; i > 0; i--) {
				let rand = Math.ceil(Math.random() * i); //根据arr数组长度，随机产生一个索引
				//从原数组arr把该索引的元素删除，并加入到result数组--便是随机产生啦
				result.push(arr.splice(rand, 1));
			}
      		return result;
    	},
    	//测试一下
    	addwj() {
			this.startgame = true;
			var j = 0;
			var i = setInterval(() => {
				if (this.gamelist.length >= 10) {
					this.startgame = false;
					clearInterval(i);
				} else {
					//  var x=[15,16,32,35,44,60,72,58,85,90,];
					//  var y=[39,71,5,26,76,10,72,58,33,35];
					var c = this.RandomNum(0, 5);
					var a = this.RandomNum(15, 80);
					var b = this.RandomNum(10, 85);
					if (Math.abs(a - b) < 25) {
						return;
					}
					if (c != this.s.gameLevel) {
						j++;
					}
					if (j == 10) {
						c = this.s.gameLevel;
					}
          			this.gamelist.push({ a: a, b: b, c: c });
        		}
      		}, 300);
      		console.log(this.gamelist);
    	},
    	RandomNum(Min, Max) {
			var Range = Max - Min;
			var Rand = Math.random();
			if (Math.round(Rand * Range) == 0) {
				return Min + 1;
			}
      		var num = Min + Math.round(Rand * Range);
      		return num;
    	},
    	wkz() {
			this.atime = 3;
			this.getgameNum();
      		this.ktimer = setInterval(() => {
        		if (this.ktime == 0) {
					this.suoding = false;
					this.ktime = 5;
					this.gameshow = 4;
					clearInterval(this.ktimer);
          			setTimeout(() => {
						if (this.sfzj) {
							this.winshow = true;
						} else {
							this.losershow = true;
						}
            			this.regame();
          			}, 1000);
        		}
        		this.ktime--;
      		}, 1000);
    	},
		onCopy() {
			this.$toast(this.$i18n.t("m.fzcg"));
		},
		onError() {
			this.$toast(this.$i18n.t("m.fzsb"));
		},
		myinfo() {
			this.show = true;
		},
		tishis() {
			this.tishi = !this.tishi;
		},
    	start() {
			if (!this.s.recommendCode) {
				this.yqshow = true;
			}
      		if (this.suoding) {
        		return;
      		} else {
        		this.suoding = true;
        		this.$get({
          			url: "gms-history/matching/" + this.$store.getters.nameid,
          			data: {},
          			callback: (data) => {
            			this.$nextTick(function () {
              				var list = data.data;
              				if (list) {
                				this.addwj();
								if (this.gameshow) {
									this.gameshow = 2;
									this.timer = setInterval(() => {
										if (this.gamelist.length >= 10 && this.time <= 0) {
											this.time = 5;
											this.gameshow = 3;
											this.getbs();
											clearInterval(this.timer);
										} else {
											if (this.time == 0) {
												this.time = 0;
											} else {
												this.time--;
											}
										}
									}, 1000);
								}
              				} else {
								this.suoding = false;
								this.getgameNum();
								if (this.dqyy == "en-US") {
									this.$toast(this.$i18n.t("m.yxtj"));
								} else {
									this.$toast(data.message);
								}
								if (data.message == "游戏局数不足" || data.message == "游戏次数不足" ||data.message == "今日游戏局数不足") {
                  					this.buysl();
                				}
              				}
            			});
          			},
        		}).catch(() => {
					this.suoding = false;
					this.$toast(this.$i18n.t("m.errordata"));
        		});
      		}
    	},
    	getgameNum() {
      		this.$get({
        		url: "wms-wallet/user-game-info/" + this.$store.getters.userWallet,
        		data: {},
				callback: (data) => {
					this.$nextTick(function () {
						if (data.data) {
							this.tt = data.data;
							if (this.tt.gsecret != 0) {
								this.ggmode = true;
							}
							if (!this.tt.isHasRec && this.yqmcode) {
								this.yqma = this.yqmcode;
								this.yqmaos();
							}
						}
					});
				},
      		});
    	},
    	getbs() {
      		this.$get({
				url: "gms-history/gamStart/" + this.$store.getters.nameid,
				data: {},
        		callback: (data) => {
          			this.$nextTick(function () {
            			var list = data.data;
						if (list) {
							this.wkz();
							this.baseFt = list.gameBonusDOT;
							this.baseCny = list.gameBonusUSDT;
							this.userId = list.winUserId;
							if (this.userId == this.$store.getters.nameid) {
								this.sfzj = true;
							} else {
								this.sfzj = false;
							}
						}
          			});
        		},
			}).catch(() => {
				this.suoding = false;
				this.$toast(this.$i18n.t("m.errordata"));
			});
    	},
		muisc() {
			if (this.music == 1) {
				this.music = 0;
			} else {
				this.music = 1;
			}
			this.$store.commit("editbjmuiscs", this.music);
		},
		autogames() {
			this.tgshow = !this.tgshow;
		},
    	goto(val) {
			if (this.gameshow == 0) {
				return;
			}
			this.show = false;
			this.$router.push({ path: val });
			// sessionStorage.setItem("pages", val);
			// this.inshow = sessionStorage.getItem("pages");
    	},
		yqhaos() {
			this.yqhyshow = false;
		},
		
    	myxx() {},
		changercolse(data) {
			if (data) {
				sessionStorage.setItem("pages", "index");
				this.inshow = sessionStorage.getItem("pages");
			}
		},
		
		changer(val) {
			this.slactive = val;
			this.vips = this.hylist[val];
		},
    	slmode() {
      		if (this.hysuoding) {
        		return;
      		} else {
				this.hysuoding = true;
				this.$toast.loading();
				const datas = {
					uid: this.$store.getters.nameid,
					cid: this.vips.id,
					spec: this.vips.dot,
				};
        		this.$post({
          			url: "ums-contract-history/createObj",
          			data: datas,
          			callback: (data) => {
            			this.$nextTick(function () {
              				var d = data.data;
              				if (d) {
								this.$toast(this.$i18n.t("m.gmcg"));
								this.slshow = false;
								this.getdata();
              				} else {
                				this.hysuoding = false;
                				if (data.message == "TOT资产余额不足") {
                  					setTimeout(() => {
										this.$dialog.confirm({
											title: this.$i18n.t("m.txt"),
											message: this.$i18n.t("m.qrdht"),
											confirmButtonText: this.$i18n.t("m.qding"),
											cancelButtonText: this.$i18n.t("m.gb"),
										}).then(() => {
											this.goto("bzdh");
										});
									}, 1000);
                				}
                				if (this.dqyy == "zh-CN") {
                  					this.$toast(data.message);
                				} else {
                  					if (data.message == "请先绑定邀请码") {
                    					this.$toast(this.$i18n.t("m.qxbdya"));
									} else {
										this.$toast(this.$i18n.t("m.messageerror"));
									}
                				}
              				}
           				});
          			},
        		}).catch(() => {
					this.hysuoding = false;
					this.$toast(this.$i18n.t("m.errordata"));
        		});
      		}
    	},

		guanbi() {
			this.dqslshow = false;
			this.buysl();
		},
		seebuysl() {
			if (this.s.contractLeve > 0) {
				this.dqslshow = true;
			} else {
				this.buysl();
			}
		},
    	buysl() {
			this.show = false;
			this.$toast.loading();
			let datas = {
				params: {
					state: 1,
				},
			};
      		this.$get({
				url: "ums-contract/getList",
				data: datas,
				callback: (data) => {
					this.$nextTick(function () {
						this.hylist = data.data;
						this.vips = this.hylist[0];
						this.slshow = true;
						this.hysuoding = false;
					});
				},
			}).catch(() => {
				this.$toast(this.$i18n.t("m.errordata"));
			});
    	},
		jixu() {
			this.gamelist = [];
			this.winshow = false;
			this.losershow = false;
			this.gameshow = 1;
			this.start();
			clearInterval(this.atimer);
		},
    	regame() {
      		if (this.tgshow) {
        		this.atimer = setInterval(() => {
          			if (this.atime == 0) {
            			this.jixu();
            			this.atime = 0;
					} else {
						this.atime--;
					}
        		}, 1000);
      		} else {
        		return;
      		}
    	},
		quxiao() {
			this.gamelist = [];
			this.winshow = false;
			this.losershow = false;
			this.gameshow = 1;
			this.getgameNum();
			this.getdata();
		},
		gball() {
			this.showyy = false;
			this.weixin = false;
			this.tishi = false;
		},
		changeryys(val) {
			this.$i18n.locale = val;
			this.showyy = false;
			this.$store.commit("language", val);
		},
    	get() {
      		let api = "https://apilist.tronscan.io/api/token_trc20?contract=TWBu2NEjHbo6Wg8T6JrrebPLLmExEsrqPd&showAll=1";
      		return new Promise((resolve, reject) => {
        		this.$axios.get(api).then((res) => {
					if (res.data.trc20_tokens[0]) {
						this.holders_count = res.data.trc20_tokens[0].holders_count;
					} else {
						this.holders_count = 0;
					}
          		}).catch((err) => {
            		reject(err);
          		});
      		});
    	},

    	daojshi(val) {
      		this.wtime = val;
      		this.wtimer = setInterval(() => {
        		if (this.wtime == 0) {
          			this.wtime = 1800;
          			clearInterval(this.wtimer);
				} else {
					this.wtime--;
				}
      		}, 1000);
    	},
    	getfhtime() {
			setInterval(() => {
				var x = new Date();
				x.setHours(0, 0, 0, 0);
				var y = new Date();
				var b = y.getTime() - x.getTime();
				var djs = 86400000 - b;
				this.fhdjs = this.format(djs);
			}, 1000);
    	},
		add0(m) {
			return m < 10 ? "0" + m : m;
		},
		format(shijianchuo) {
			//shijianchuo是整数，否则要parseInt转换
			var t = new Date(parseInt(shijianchuo));
			var h = Math.floor((t / 1000 / 60 / 60) % 24);
			var m = Math.floor((t / 1000 / 60) % 60);
			var s = Math.floor((t / 1000) % 60);
			return h + "h" + this.add0(m) + "m" + this.add0(s) + "s";
		},

    	endformat(time) {
      		let newTime, hour, minite, seconds;
      		if (time >= 1800) {
        		hour = parseInt(time / 1800) < 10? "0" + parseInt(time / 1800): parseInt(time / 1800);
        		minite = parseInt((time % 60) / 60) < 10 ? "0" + parseInt((time % 60) / 60) : parseInt((time % 60) / 60);
        		seconds = time % 1800 < 10 ? "0" + (time % 1800) : time % 1800;
        		newTime = hour + ":" + minite + ":" + seconds;
      		} else if (time >= 60 && time < 1800) {
        		minite = parseInt(time / 60) < 10 ? "0" + parseInt(time / 60) : parseInt(time / 60);
				seconds = time % 60 < 10 ? "0" + (time % 60) : time % 60;
				newTime = minite + ":" + seconds;
			} else if (time < 60) {
				seconds = time < 10 ? "0" + time : time;
				newTime = "00:" + seconds;
			}
      		return newTime;
    	},
		// async getlist() {
		// 	var lie = [];
		// 	for (var is = 0; is < 10; is++) {
		// 		await getABIs(is).then((s) => {
		// 			if (s != "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb") {
		// 				lie.push({ address: s, isd: is });
		// 			} else {
		// 				return;
		// 			}
		// 		});
		// 	}
		// 	this.list = lie.reverse();
		// },
		showweixin() {
			this.weixin = !this.weixin;
		},

    	getdata() {
			this.getRate();
			this.getgameNum();
			let datas = {
				params: {
					address: this.$store.getters.userWallet,
				},
			};
      		this.$get({
        		url: "wms-wallet/getWallet",
        		data: datas,
        		callback: (data) => {
          			this.$nextTick(function () {
            			this.s = data.data;
						if (this.s) {
							this.$store.commit("nameid", this.s.id);
							this.$store.commit("s", this.s);
							this.code = "https://www.tronstar.org?code=" + this.s.recommendCode;
						}
          			});
        		},
			}).catch(() => {
				this.$toast(this.$i18n.t("m.errordata"));
			});
    	},
		goa() {
			window.location.href = "https://justswap.network";
		},
		gott() {
			window.location.href = "https://mobile.twitter.com/tronstar10";
		},
		gotohydz() {
			window.location.href = "https://tronscan.io/#/contract/TWBu2NEjHbo6Wg8T6JrrebPLLmExEsrqPd";
		},
    	getbasedata() {
      		let datas = { 
				params: { 
					address: this.$store.getters.userWallet,
				},
      		};
      		this.$get({
        		url: "wms-wallet/getWallet",
        		data: datas,
        		callback: (data) => {
          			this.$nextTick(function () {
            			var s = data.data;
						if (s) {
							sessionStorage.setItem("s", JSON.stringify(s));
						}
          			});
        		},
			}).catch(() => {
				this.$toast(this.$i18n.t("m.errordata"));
			});
    	},
  	},
  	watch: {
    	"$store.getters.language": function (val) {
			//你需要执行的代码
			this.$i18n.locale = val;
			// this.getRate();
    	},
  	},
};
</script>

<style  scoped>
	.btops{
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0.2rem 0.45rem;
	}
	.btops .menu{
		width: 0.45rem;
		height: 0.35rem;
		background: url("../assets/images/menu.png")center center no-repeat;
		background-size: 100%;
	}
	.btops .addsde{
		font-size: 0.22rem;
		margin-left: 0;
	}
	.btops .logo{
		width: 3rem;
	}
	.btops .logo img{
		width: 100%;
	}
	.banner{
		width: 100%;
		height: 2.43rem;
		padding: 0 0.12rem;
		box-sizing: border-box;
	}
	.banner .my-swipe{
		height: 2.4rem;
	}
	.banner .van-swipe-item{
		border-radius: 0.1rem;
		overflow: hidden;
	}
	.banner img{
		width: 100%;
		height: 2.43rem;
		
	}
	.assets{
		margin: 0.2rem 0.2rem 0 0.2rem;
		padding:0.3rem 0.2rem 0.35rem 0.2rem;
		text-align: left;
		border: 0.02rem solid #235580;
		background-color: rgba(0,0, 0, 0.05);
		border-radius: 0.1rem;
		position: relative;
	}
	.assets .lf .center{
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.assets .lf .title,.assets .lf .price{
		display: flex;
		justify-content: space-between;
		font-size: 0.3rem;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #53FBFD;
		line-height: 0.3rem;
	}
	.assets .lf .title p{
		margin: 0.15rem 0;
	}
	.assets .lf .number{
		font-size: 0.4rem;
		font-family: Microsoft YaHei;
		font-weight: bold;
		color: #FFFFFF;
		line-height: 0.4rem;
		margin-top: 0.1rem;
	}
	.assets .lf .number span{
		font-size: 0.3rem;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #53FBFD;
		line-height: 0.3rem;
	}
	.assets .lr{
		width: 1.91rem;
		height: 0.82rem;
		background:url("../assets/images/zc_bg.png")center center no-repeat;
		background-size: 100%;
		padding-left: 0.42rem;
		padding-top: 0.19rem;
		box-sizing: border-box;
	}
	.assets .lr .btn{
		background:url("../assets/images/zc.png")left center no-repeat;
		background-size: 0.46rem 0.45rem;
		padding-left: 0.46rem;
		line-height: 0.46rem;
		font-size: 0.3rem;
		font-family: Microsoft YaHei;
		font-weight: bold;
		color: #FFFFFF;
	}
	.assets .btm .title p{
		font-size: 0.28rem;
	}
	.assets .btm .price p{
		margin:  0;
		color: #FFFFFF;
	}
	.assets .more{
		width: 100%;
		font-size: 0.4rem;
		color: #01FFFB;
		text-align: center;
		position: absolute;
		left: 0;
		bottom: -0.1rem;
	}
	.assets .more img{
		width: 0.3rem;
		height: 0.3rem;
	}
	.assets .more.active{
		background-color: transparent;
		transform: rotate(180deg);
	}
	.pool{
		text-align: left;
		margin: 0 0.2rem;
		
	}
	.pool>.title{
		display: flex;
		justify-content: space-between;
		padding: 0.2rem 0;
	}
	.pool>.title p{
		width: 25%;
		padding-top: 1rem;
		font-size: 0.22rem;
		color: #01FFFB;
		text-align:center;
	}
	.pool>.title p:nth-child(1){
		background:url('../assets/images/navico1.png')top center no-repeat;
		background-size: 0.8rem;
	}
	.pool>.title p:nth-child(1).navactive{
		background:url('../assets/images/anavico1.png')top center no-repeat;
		background-size: 0.8rem;
		color: #FFFFFF;
	}
	.pool>.title p:nth-child(2){
		background:url('../assets/images/navico3.png')top center no-repeat;
		background-size: 0.8rem;
	}
	.pool>.title p:nth-child(2).navactive{
		background:url('../assets/images/anavico3.png')top center no-repeat;
		background-size: 0.8rem;
		color: #FFFFFF;
	}
	.pool>.title p:nth-child(3){
		background:url('../assets/images/navico4.png')top center no-repeat;
		background-size: 0.8rem;
	}
	.pool>.title p:nth-child(3).navactive{
		background:url('../assets/images/anavico3.png')top center no-repeat;
		background-size: 0.8rem;
		color: #FFFFFF;
	}
	.pool>.title p:nth-child(4){
		background:url('../assets/images/navico2.png')top center no-repeat;
		background-size: 0.8rem;
	}
	.pool>.title p:nth-child(4).navactive{
		background:url('../assets/images/anavico4.png')top center no-repeat;
		background-size: 0.8rem;
		color: #FFFFFF;
	}
	.pool .item{
		border-bottom: 0.02rem solid #235580;
		padding: 0.27rem 0.45rem 0.3rem 0.41rem;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: rgba(255,255, 255, 0.05);
		border-radius: 0.1rem;
	}
	.pool .item:last-child{
		border: 0;
	}
	.pool .item .lf{
		width: calc(100% - 1.71rem);
	}
	.pool .item .lf .title{
		display: flex;
		align-items: center;
		font-size: 0.32rem;
		font-family: Microsoft YaHei;
		font-weight: bold;
		color: #53FBFD;
		line-height: 0.59rem;
	}
	.pool .item .lf .title p{
		margin: 0;
	}
	.pool .item .lf .title img{
		width: 0.34rem;
		height: 0.34rem;
		margin-right: 0.11rem;
	}
	.pool .item .lf .btm{
		display: flex;
	}
	.pool .item .lf .btm .btm_item{
		margin-right: 0.35rem;
	}
	.pool .item .lf .btm .item_title{
		font-size: 0.24rem;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #acb1b1;
		line-height: 0.33rem;
	}
	.pool .item .lf .btm .item_cont{
		color: #FFFFFF;
		margin: 0.2rem 0;
		font-size: 0.3rem;
		line-height: 0.2rem;
		font-weight: bold;
	}
	.pool .item .lr{
		width: 1.61rem;
		height: 0.7rem;
		font-size: 0.3rem;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 0.7rem;
		text-align: center;
		border-radius: 0.1rem;
		/* background: url("../assets/images/zc_bg.png")center center no-repeat; */
		border: 1px solid #01FFFB;
		background-color: #1b5352;
		box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
		background-size: 100%;
	}
	.activation-bg{
		background: url() no-repeat;
		background-size: 100% 100%;
		height: 5.42rem;
		width: 80vw;
	}
	.activation_cont .title{
		margin-top: 0.44rem;
		margin-bottom: 0.2rem;
		font-size: 0.37rem;
		font-weight: bold;
		color: #01FFFB;
		line-height: 0.47rem;
	}
	.activation_cont .item{
		display: flex;
		justify-content: space-between;
		margin: 0 0.32rem;
		font-size: 0.25rem;
		font-weight: 300;
		color: #01FFFB;
		line-height: 0.4rem;
		border-bottom: 1px solid #01FFFB;
	}
	.activation_cont .close{
		width: 2.33rem;
		height: 0.95rem;
		background: url("../assets/images/zc_bg.png")center center no-repeat;
		background-size: 100%;
		margin: 0.2rem auto;
		font-size: 0.18rem;
		line-height: 0.95rem;
		color: #FFFFFF;
		font-weight: bold;
	}
	.yqm_con{
		width: 100%;
	}
	.yqm_con .tts{
		text-align: center;
	}
	.tright{
		width: auto;
	}
	.lang_ico{
		vertical-align: middle;
		height: 0.8rem;
	}
	.lang_ico img{
		width: 0.8rem;
		height: 0.8rem;
		display: block;
	}
	.footer{
		display: flex;
		justify-content: center;
	}
	.footer .item{
		font-size: 0.24rem;
		color: #FFFFFF;
		padding-left: 0.45rem;
		background:url("../assets/images/foot_ico3.png")left center no-repeat;
		background-size: 0.34rem 0.32rem;
		margin-right: 0.4rem;
	}
	.footer .item:nth-child(2){
		background:url("../assets/images/foot_ico2.png")left center no-repeat;
		background-size: 0.34rem 0.32rem;
	}
	.footer .item:nth-child(3){
		background:url("../assets/images/foot_ico1.png")left center no-repeat;
		background-size: 0.34rem 0.32rem;
		margin-right: 0;
	}
	.link_title{
		font-size: 0.28rem;
		font-weight: bold;
		color: #FFFFFF;
		margin-bottom: 0.4rem;
	}
	.links{
		display: flex;
		justify-content:space-between;
		flex-wrap: wrap;
	}
	.links .item{
		width: 24%;
		margin-bottom: 0.2rem;
	}
	.links .item .title{
		font-size: 0.22rem;
		margin: 0.2rem 0;
	}
	.links .item img,.links .item .img{
		width: 1rem;
		height: 1rem;
		margin: 0 auto;
	}
	.contractlist{
		font-size: 0.25rem;
		background-color: #FFFFFF;
		min-height: 50vh;
		padding: 0.3rem;
	}
	.contractlist .item{
		display: flex;
		justify-content: space-between;
		padding: 0.2rem 0;
		border-bottom: 1px solid #f5f5f5;
		align-items: center;
	}
	.contractlist .item .btn{
		padding: 0.05rem 0.1rem;
		border: 1px solid #1b5352;
		background-color: #1b5352;
		color: #f5f5f5;
		border-radius: 0.05rem;
	}
	.contractlist .item .sj{
		padding: 0.05rem 0.1rem;
		border: 1px solid #e0dddd;
		border-radius: 0.05rem;
	}
	.contractlist .item .title{
		font-size: 0.3rem;
		color: #333333;
		margin-bottom: 0.1rem;
	}
</style>